In a line of text, it is probably a better idea to type f : AB than AfB. Nevertheless the Diagram Macros allow you to give an upper name to the single in-text arrows as well as an upper-lower name to the double in-text arrows. It is a general rule of the Diagram Macros that to give an upper name to a single arrow or an upper-lower name to a double arrow, it suffices to
plain arrow f | +f+ | f |
dotted arrow f | +f+ | f |
monomorphism f | +f+ | f |
epimorphism f | +f+ | f |
bimorphism f | +f+ | f |
isomorphism f | +f+ | f |
pair of parallel arrows f, g | +fg+ | fg |
pair of adjoint arrows f, g | +fg+ | fg |
backward plain arrow f | +f+ | f |
backward dotted arrow f | +f+ | f |
backward monomorphism f | +f+ | f |
backward epimorphism f | +f+ | f |
backward bimorphism f | +f+ | f |
backward isomorphism f | +f+ | f |
pair of parallel backward arrows f, g | +fg+ | fg |
backward pair of adjointarrows f, g | +fg+ | fg |
The name of an arrow will always be processed in Math mode at the scripstyle size; therefore the text characters will be printed in Math italic and you should not type any $ sign to introduce a mathematical symbol in the name of an arrow.